package com.student.controller;

import com.student.dto.ResponseDto;
import com.student.pojo.VenueReser;
import com.student.pojo.Venues;
import com.student.service.VenuesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: SupportGroup
 * @BelongsPackage: com.student.controller
 * @Author: 小徐
 * @CreateTime: 2025-02-28 16:06
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("Venues")
public class VenuesController {
    @Autowired
    private VenuesService venuesService;


    /**
     * 获取场地详细信息
     *
     * @param venues
     * @return
     */
    @RequestMapping("getAllVenues")
    public ResponseDto getAllVenues(@RequestBody Venues venues) {
        return venuesService.getAllVenues(venues);
    }

    /**
     * 添加场地信息
     *
     * @param venues
     * @return
     */
    @RequestMapping("addVenues")
    public ResponseDto addVenues(@RequestBody Venues venues) {
        return venuesService.addVenues(venues);
    }

    /**
     * 这边是修改场地信息
     *
     * @param venues
     * @return
     */
    @RequestMapping("updateVenues")
    public ResponseDto updateVenues(@RequestBody Venues venues) {
        return venuesService.updateVenues(venues);
    }

    /**
     * 这边是进行删除操作  删除场地信息
     *
     * @param id
     * @return
     */
    @RequestMapping("deleteVenues")
    public ResponseDto deleteVenues(@RequestParam("id") Integer id) {
        return venuesService.deleteVenues(id);
    }

    @RequestMapping("getAllVenuesMessage")
    public ResponseDto getAllVenuesMessage() {
        return venuesService.getAllVenuesMessage();
    }

    @RequestMapping("addBooking")
    public ResponseDto addBooking(@RequestParam("idCard") String idCard,
                                  @RequestParam("phone") String phone,
                                  @RequestParam("id") Integer id,
                                  @RequestParam("venuesId") Integer venuesId,
                                  @RequestParam("artistId") Integer artistId,
                                  @RequestParam("titleId") Integer titleId) {
        return venuesService.addBooking(idCard, id, phone, venuesId, artistId,titleId);

    }

    @RequestMapping("getAllVenuesUserMessage")
    public ResponseDto getAllVenuesUserMessage(@RequestBody VenueReser venueReser) {
        return venuesService.getAllVenuesUserMessage(venueReser);
    }
}